Page({
  data: { showName: '', Phone: '', comefrom: 'default', back_type: 'index' },
  onLoad: function (e) {
    console.log('到了登录页， options: ', e);
    var o = getCurrentPages(),
      t = 'packageOrder/pages/orderList/orderList' === o[o.length - 2].route;
    this.setData({
      comefrom: e.comefrom || 'default',
      back_type: t ? 'back' : 'index',
    });
  },
  onReady: function () {},
  back: function () {
    var e = this.data.comefrom,
      o = getCurrentPages();
    if ('packageOrder/pages/orderList/orderList' === o[o.length - 2].route)
      wx.navigateBack({ delta: 1 });
    else if ('default' === e)
      setTimeout(function () {
        wx.switchTab({ url: '/pages/index/index' });
      }, 1e3);
    else if ('live' === e) {
      var t = wx.getStorageSync('rid');
      console.log('进入【登录页】锁粉逻辑，rid:', t),
        getApp()
          .$api.user.bindSuperior({ referrer_uid: t }, { errorKill: !1 })
          .then(function (e) {
            console.log('【登录页】锁粉回调：', e),
              wx.showToast({
                title: '开始快乐的购物之旅吧~',
                icon: 'none',
                duration: 800,
              }),
              wx.setStorageSync('hasCode', 1),
              wx.setStorageSync('sentCode', 1),
              wx.navigateBack({ delta: 1 });
          });
    }
  },
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {},
});
